package com.htgd.gardenexpo.dao;

import com.htgd.gardenexpo.entity.GeConTheaterPlanReserve;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.htgd.gardenexpo.vo.MyTheaterRecordVO;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 * 剧场预约 Mapper 接口
 * </p>
 *
 * @author author
 * @since 2025-04-17
 */
public interface GeConTheaterPlanReserveMapper extends BaseMapper<GeConTheaterPlanReserve> {

    @Select("SELECT COALESCE(SUM(num),0)  FROM `ge_con_theater_plan_reserve` WHERE plan_id = #{planId}")
    long getReserveNum(@Param("planId") String planId);

    List<MyTheaterRecordVO> getMyRecord(@Param("openId") String openId);
}
